#pragma once
#include<iostream>
#include<assert.h>
using namespace std;
namespace My_string
{
	class string
	{
	public:
		typedef char* iterator;
		typedef const char* const_iterator;
		string(const char* str = "");
		string(const string& s);
		string& operator=(const string& s);
		~string();
		void reserve(size_t s);
		const char* c_str()const;
		size_t size()const;
		iterator begin();
		iterator end();
		const_iterator begin()const;
		const_iterator end()const;
		void push_back(char ch);
		void append(const char* str);
		void insert(size_t pos, char ch);
		void erase(size_t pos, size_t len = npos);
		size_t find(char ch, size_t pos);
		size_t find(const char* sub, size_t pos);
	private:

		char* _str;
		size_t _size;
		size_t _capacity;
		const static size_t npos;
	};
}
